package com.qingcloud.fexecutor.base.enums;

/**
 * 提交状态枚举
 *
 * @author wangjinnan
 */
public enum SubmitStateEnum {

    /**
     * 未提交
     */
    NO(0, "草稿"),

    /**
     * 未提交
     */
    SUBMIT(2, "源码提交"),

    /**
     * 已提交
     */
    YES(1, "已发布");

    /**
     * 类型编码
     */
    public final Integer code;

    /**
     * 描述
     */
    public final String desc;

    SubmitStateEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDescByCode(Integer code) {
        for (SubmitStateEnum item : SubmitStateEnum.values()) {
            if (item.code.equals(code)) {
                return item.desc;
            }
        }
        return "";
    }
}
